/*
*********************************
	  SF2D Engine
*********************************

	By Julian Williams
	September 26, 2010
**********************************

	Description:

		Used to model the physics
	simulation of objects in the 
	game world
***********************************
*/
#include "physics_world.h"
#include "physics_actor.h"



PhysicsActor::PhysicsActor(b2World *world, b2BodyDef bodyDef, b2FixtureDef fixtureDef)
{
	Setup(world, bodyDef, fixtureDef);
}

void PhysicsActor::Setup(b2World *world, b2BodyDef bodyDef, b2FixtureDef fixtureDef)
{
	//bodyDef.position.Set(width/2*METERS_PER_PIXEL, height/2*METERS_PER_PIXEL);
	//create the dynamic body
	body = world->CreateBody(&bodyDef);
	//shape of the dynamic body
	//b2PolygonShape dynamicBox;
	//dynamicBox.SetAsBox(64.0f/2*METERS_PER_PIXEL, 64.0f/2*METERS_PER_PIXEL);
	//fix the shape to the dynamic body
	/*
	b2FixtureDef fixtureDef;
	fixtureDef.shape = &dynamicBox;
	fixtureDef.density = 1.0f;
	fixtureDef.friction = 0.3f;
	fixtureDef.restitution = 0.5f;
	*/
	//apply the fixture to the body
	body->CreateFixture(&fixtureDef);
}


